<?php
$p = new cmsdream_post();
$p->setting->posts_per_page = $this->setting->posts_per_rss;

if($this->query->is_post || $this->query->is_attachment || $this->query->is_page) {	
	$this->template = "feed-post";
	if($this->query->is_post) 		$post = $p->getPost();
	if($this->query->is_attachment) $post = $p->getAttachment();
	if($this->query->is_page) 		$post = $p->getPage();
	if(empty($post)) {
		header("Location:" . $this->url("home") . "/feed");
		exit;
	}
	$comments = $p->getComment($post->ID, 0, false);
} else {	
	$this->template = "feed";
	$posts = $p->getList();	
}

